Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

session renewal support for both json and html #57

Merged
merged 2 commits into from
Feb 9, 2024
Merged

Conversation

nitesh3108
Copy link
Collaborator

PR Submission checklist

This PR is to handle session renewal issue with OneFS 9.5 onwards, earlier versions of OneFS still returns with json response but 9.5 onwards the response type would be html.

GitHub Issues

List the GitHub issues impacted by this PR:

GitHub Issue #
dell/csm#1134

Common PR Checklist:

  • Have you made sure that the code compiles?
  • Have you commented your code, particularly in hard-to-understand areas
  • Did you run tests in a real Kubernetes cluster?
  • Have you maintained backward compatibility

Tests Performed:

1. Validated the fix on OneFS 9.5.0.6 (HTML response)

a) Driver Installation

# k get po -n isilon
NAME                                 READY   STATUS    RESTARTS   AGE
isilon-controller-86d7ccf449-7k95w   6/6     Running   0          101m
isilon-node-lqg6j                    2/2     Running   0          101m

b) Session renewal

[DEBUG]
    -------------------------- GOISILON HTTP RESPONSE -------------------------
    HTTP/1.1 401 Unauthorized
    Content-Length: 486
    Accept-Ranges: bytes
    Content-Security-Policy: default-src 'self' 'unsafe-inline' 'unsafe-eval' data:; script-src 'self' 'unsafe-eval'; style-src 'unsafe-inline' 'self';
    Content-Type: text/html
    Date: Thu, 08 Feb 2024 08:50:17 GMT
    Etag: "1e6-5efe861188000"
    Last-Modified: Fri, 16 Dec 2022 02:03:44 GMT
    Server: Apache
    Strict-Transport-Security: max-age=31536000;
    Www-Authenticate: Basic
    X-Content-Type-Options: nosniff
    X-Frame-Options: sameorigin
    X-Xss-Protection: 1; mode=block

[DEBUG] Authentication failed. Trying to re-authenticate
[DEBUG]
    -------------------------- GOISILON HTTP REQUEST -------------------------
    POST /session/1/session/ HTTP/1.1
    Host: 1.1.1.1:8080
    Content-Type: application/json
    Cookie: isisessid=****-zZ-3niAN71v_cTibZyK905wE9QfqkG-QAK-8z7cYf3X6W0P6Optv9Qo_wJc4qxr4eKG0rI-gkzUnKmRjqUsU51KXSgLbTH_W00p06MWtAg58nL9Eccl6LieA26IDaHCZDBv8dr5lHDOxCCUihS6N2mQXpQ1R22ZWGlqGnUHojx2gamdLA0-m4Dh4tjLsxGzvPZ10kjiun8LWPhEr1FS1ZmbZ-WUJdatJQkElcxYWx3EhG-NtLMNlnTbRSGMCwTKrIkvKq-_QxbP68l9O4cyTHEnWF8hV8xlLyoIg_c-ow1aQau8025o9uqRm07laTdAuRQeHUIFoLkEUI1XciDHfDM36NRy8eyIQsOukhgkiOPHbDBJBwr5W-5kWK_EAxyAcAMaHiP0s3kXfT2tojLBX_pEo-e_MzhQFkOX6J9aKES4yELiR69ujY0f_s2N2i80dmEUQPUb2VlHLrVX10_idta8Qcf3urT9gDy8m-1lJYC5nedRRHPx4GVWMzKXcNS_L113xBF5LdGHJFr-1XmXn5sF4DPS_BUtXAbKyy3Rl-QhTmC-ZmN6z_KXwH3KN4nvg3bnVJyX_5fZ5EzpsHqZ4lhs6WQ2_mUsbQXGasI3O3w%3D
    Referer: https://1.1.1.1:8080
    X-Csrf-Token:****-dc54-4f10-81e8-c815f8239b69

    {"services":["platform","namespace"],"username":"xxxx","password":"****"}

[DEBUG] Authentication response code: 201
[DEBUG] Authentication successful

2. Validated the fix on OneFS 9.3 (JSON response)
a) Driver Installation

 # k get po -n isilon
NAME                                READY   STATUS              RESTARTS   AGE
isilon-controller-544dcdf7d-j2dgk   6/6     Running             0          5h46m
isilon-node-8th6s                   2/2     Running             0          5h46m

b) Session renewal

[DEBUG]
    -------------------------- GOISILON HTTP RESPONSE -------------------------
    HTTP/1.1 401 Unauthorized
    Content-Length: 50
    Accept-Ranges: bytes
    Content-Security-Policy: default-src 'self' 'unsafe-inline' 'unsafe-eval' data:; script-src 'self' 'unsafe-eval'; style-src 'unsafe-inline' 'self';
    Content-Type: application/json
    Date: Thu, 08 Feb 2024 06:47:45 GMT
    Etag: "32-5cbd545701840"
    Last-Modified: Mon, 13 Sep 2021 00:08:57 GMT
    Server: Apache
    Strict-Transport-Security: max-age=31536000;
    Www-Authenticate: Basic
    X-Content-Type-Options: nosniff
    X-Frame-Options: sameorigin

[DEBUG] Authentication failed. Trying to re-authenticate
[DEBUG]
    -------------------------- GOISILON HTTP REQUEST -------------------------
    POST /session/1/session/ HTTP/1.1
    Host: 2.2.2.2:8080
    Content-Type: application/json
    Cookie: isisessid=****-PxTad6DWvVvXhH_2D4te0zDJ30ArkiSJozpUeTQPY09I-EguQmgtClDCQM7HOxEkumZlb_tFd_BZl9RJ4DhrPyF_t_CmbtaZWHwEAtm3hSmmf62Ae7-qNP_vJlhxD-n0W3Svi1Z7VmWNoGKVJlwkMDyY3A6a5pgezDCTr6oPx27ZKTyXif-R0s75shHfVZND7s7Gm8OUwzXw3e7eoDf3_0egjGxIJtxzILE7Mm-txfOGpV8GcJjFC5kucvNmLhdd9IV37VVXM1odCssCklP6V5i5Ux9eqoLzo-Qov0SmVIVzSKBaIG3FhrpOkeIaZf1qjbP9wSju9ZHgcvac4kBs2X-dyeiZO6tqluMBqHH82Jy5dNLvsaH25Rl8tmrmXDERJ7u3tuz0lb9n3_O2drwnO6YZFSDgI4pDVak5OFDZ3bd4f8Suad05hGJj7rKEaROPfmiKQWg4QPx_QDx-vdl8aHOrGXmGJ3p70L1Qi_0wzV7jo04eWyK1OpcDysXzhLtALJoTjX3h4WEBX-oKIm4e_Gv_miWE-wKNK_5EEXK8GT6mDw4zCO1sRR4BV1kW8XGXuoQTJUPERVUxyxmNhWbqwMDldtfVLcKypIwObUpTUs%3D
    Referer: https://2.2.2.2:8080
    X-Csrf-Token:****-7d5f-41b8-ae07-cabc4482c143

    {"services":["platform","namespace"],"username":"xxxx","password":"****"}

[DEBUG] Authentication response code: 201
[DEBUG] Authentication successful

Copy link
Contributor

@HarishH-DELL HarishH-DELL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

api/api.go Outdated Show resolved Hide resolved
Copy link

@rajkumar-palani rajkumar-palani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you please check and update the review comments.

api/api.go Outdated Show resolved Hide resolved
api/api.go Show resolved Hide resolved
api/api.go Outdated Show resolved Hide resolved
@atye
Copy link

atye commented Feb 8, 2024

Can a unit test be added?

@nitesh3108
Copy link
Collaborator Author

can you please check and update the review comments.

Addressed

@nitesh3108
Copy link
Collaborator Author

Can a unit test be added?

I didn't see UTs for this file, need to check

Copy link

@rajkumar-palani rajkumar-palani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@nitesh3108 nitesh3108 merged commit 450e3ca into main Feb 9, 2024
1 check failed
@anandrajak1 anandrajak1 deleted the sessionauth-issue branch October 17, 2024 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants